package com.yuexunit.finance.member.entity.lexicon;

/**
 * Created by HuangYH on 2015/9/24.
 */
public enum StateEnum {

	UNKNOWN("未知"), VALID("有效"), DISABLED("禁用");

	public final String state;

	StateEnum(String state) {
		this.state = state;
	}

	public String getValue() {
		return state;
	}

	/**
	 * 数字转为枚举类型
	 * @param value 0-未知,1-有效,2-禁用
	 * @return 状态枚举
	 */
	public static StateEnum valueOf(Integer value) {
		if (value == null || values().length <= value.intValue()) {
			return UNKNOWN;
		}
		return values()[value.intValue()];
	}
}
